let supportPassive=true;
try{
    window.addEventListener('click',null,{
        passive:true
    });
}catch(err){
    supportPassive=false;
}

export const addEventListener=(dom,eventName,fn)=>{
    dom.addEventListener(eventName,fn,{
        passive:true
    });
};
export const removeEventListener=(dom,eventName,fn)=>{
    dom.removeEventListener(eventName,fn,{
        passive:true
    });
};

export const preventDefault=(e)=>{
    if (e.cancelable && !e.defaultPrevented){
        e.preventDefault();
    }
};

export default addEventListener;